<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>模板插值</title>
</head>
<body>
<div id="app">
    <h1>{{ info }}</h1>
    <h1>个人信息</h1>
    <h2>姓名：{{ name }}</h2>
    <h2>性别：{{ gender }}</h2>
    <h2>年龄：{{ age }}</h2>
    <h2>年级：{{ grade }}</h2>
    <h2>数量：{{ number + 1}}</h2>
    <h2>姓名：{{ name.toUpperCase() }}</h2>
</div>

<!-- type 属性用来指定 script 里面的代码是模块化代码-->
<script type="module">
    // 导入使用的 函数
    import {createApp} from "../../../js/vue.esm-browser.js";

    // 创建 Vue 对象
    let app = createApp(
        {
            setup() {
                let info = "Hello, World";
                let person = {
                    name: "abc",
                    gender: "男",
                    age: 18,
                };

                let {name, gender, age} = person;
                const grade = 2;
                const number = 7;

                return {
                    info,
                    name,
                    gender,
                    age,
                    grade,
                    number,
                }
            }
        }
    );

    app.mount("#app")

</script>
</body>
</html>